# -*- coding: utf-8 -*-
# @Time : 2025/2/27 16:42
# @Author : debbyszhang
# @File : search_user.py
# @desc :
import allure
from playwright.sync_api import expect

from libs.tools import utils
from pageObject.user_list_page import UserListPage


@allure.feature("用户查询")
class TestSearchUser:

    def test_search_user(self, page):
        user_list_page = UserListPage(page)
        user_list_page.search_user("aaaaaa")
        content = user_list_page.page.locator('table > tbody > tr > td > span > span').text_content()
        print(content)
        assert content == '暂无数据'

        user_list_page.search_user("cross")
        user_list_data = user_list_page.get_user_list()
        print(len(user_list_data))
        assert len(user_list_data) > 0

        # expect(page.get_by_role("cell", name=username).locator("div")).to_be_visible()

